package com.java2_7;

public class danli {

    //饿汉单例模型
//    private danli(){
//
//    }
//
//    public static danli instance = new danli();

    //构造器私有化
//    private danli(){
//
//    }
//
//    public static danli instance = new danli();

    //懒汉单例模型
    private danli(){

    }

    public static danli instance;

    public static danli getInstance(){
        if(instance == null){
            instance = new danli();
        }
        return instance;
    }

}
